<%@ include file="/taglibs.jsp"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<head>
<title>北京邮电大学学生党员在线学习中心</title>

<link href="${ctx}/css/pagination.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function confirmDelete(value, b){
		if(value>0){
			alert("党组织人数不为空，不能删除！");
			return false;
		}else if(b==1){
			alert("存在下属党组织，不能删除！");
			return false;
		}else{
			return confirm("确定删除吗？");
		}
	}
</script>
</head>
<div id="nav_bar">
    <img id="nav_bar_left" src="../../../styles/nav_bar_left.png" alt=""/>
    <div id="welcome_label">欢迎您，&nbsp;<s:property value="#session.session_user.adminName" />!</div>
    <img id="nav_bar_seperator" src="../../../styles/nav_bar_seperator.png" alt=""/>
    <div id="nav_location">
        <img id="nav_bar_point" src="../../../styles/nav_bar_point.png" alt="" />
        <div id="nav_cur_location">当前位置：&nbsp;<a href="${ctx}/Admin_branchManageAction_manageBranch">党组织管理</a>&nbsp;&nbsp;>&nbsp;&nbsp;<span style="color:black;">党组织维护</span></div>
    </div>
    <img style="float:right; width:5px;" src="../../../styles/nav_bar_right.png" alt=""/>
    <a id="nav_logout" href="${ctx}/logoutAction_adminLogout">[安全退出]</a>
</div>
<div style="clear:both; height:5px;">&nbsp;</div>

<div style="min-height:450px;">
	<div id="side_menu" style="min-height:550px;">
	    <div id="side_menu_title">
	        <img src="../../../styles/side_menu_title_img.png" alt="" />
	        <span>党组织管理</span>
	    </div>
	    <div id="side_menu_title_bottom">&nbsp;</div>
	    <div class="side_sub_menu_focus">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/Admin_MyBranchAction_branchList">党组织维护</a>
	    </div>
	     <s:if test="#session.level == 2 || #session.level == 3">
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/Admin_MyBranchAction_addBranch">新增党组织</a>
	    </div>
	    </s:if>
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx }/Admin_MyBranchAction_manageBranchNotice">支部公告管理</a>
	    </div>
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx }/Admin_MyBranchAction_manageBranchActivity">支部活动管理</a>
	    </div>
	</div>
	
	<div id="main_content">
	    <div id="main_content_title">
	        <img src="../../../styles/content_title_img.png" alt="" />
	        <span>党组织维护</span>
	    </div>
	    <div class="main_content_title_bottom">&nbsp;</div>

			<table class="list-table" >
				<tr>
					<th style="width:360px;">党委名称</th>
					<th>书记</th>
					<th>党员人数</th>
					<th>相关操作</th>
				</tr>
				<s:iterator value="list" status ="st">
						<tr>
						<td style="width:360px;">
						<s:if test="level!=3">
						<a href ="${ctx}/Admin_MyBranchAction_branchList?branchId=<s:property value="id"/>"><s:property value="branchName"/></a></s:if>
						<s:else><s:property value="branchName"/></s:else>
						</td>
						<td><s:property value="branchSecretaryName"/>
						</td>
						<td>
							<s:property value="getCountStudentByBranchId(id)"/>
						</td>
						<td>
						<a href="${ctx}/Admin_MyBranchAction_browseBranch?id=<s:property value="id"/>">查看</a>
						<a href="${ctx}/Admin_MyBranchAction_updateBranch?id=<s:property value="id"/>">修改</a>
						<s:if test="level!=1"><a href="${ctx}/Admin_MyBranchAction_deleteBranch?id=<s:property value="id"/>" onclick="return confirmDelete(<s:property value="getCountStudentByBranchId(id)"/>,<s:property value="hasChild(id)"/>);">删除</a></s:if>
						</td>
						</tr>
				</s:iterator>
			</table>
			
			<br>
			
			<s:if test="#request.branchSize==0">
				<div align="center"><font color="red">下属党组织为空！</font>
				</div>
			</s:if>
			<s:elseif test="#request.list.size()!=1">
				<div align="center">
					<input id="history" name="history" type="button" class="input-button" value="返回上一级党委" onclick="window.location.href='javascript:history.go(-1);'"/>
				</div>
			</s:elseif>
			<%-- wangdong  <s:if test="#request.list.size()!=1">
				<div align="center">
					<input id="history" name="history" type="button" class="input-button" value="返回上一级党委" onclick="window.location.href='javascript:history.go(-1);'"/>
				</div>
			</s:if> --%>
		</div>
		<div style="clear:both">&nbsp;</div>
</div>